
/**
 * This is a generated class and is not intended for modification.  
 */
package com.model.valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _VoTrasactionMasterEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("cre_datetime", "trans_status", "po_sc_detserialnumber_fk", "pro_status", "cre_userid_fk", "pro_serialnumber_fk", "serialnumber", "trans_pro_qty", "trans_date", "activestatus", "trans_type", "gr_do_detserialnumber_fk", "warehouse_serialnumber_fk");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("cre_datetime", "trans_status", "po_sc_detserialnumber_fk", "pro_status", "cre_userid_fk", "pro_serialnumber_fk", "serialnumber", "trans_pro_qty", "trans_date", "activestatus", "trans_type", "gr_do_detserialnumber_fk", "warehouse_serialnumber_fk");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("cre_datetime", "trans_status", "po_sc_detserialnumber_fk", "pro_status", "cre_userid_fk", "pro_serialnumber_fk", "serialnumber", "trans_pro_qty", "trans_date", "activestatus", "trans_type", "gr_do_detserialnumber_fk", "warehouse_serialnumber_fk");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("cre_datetime", "trans_status", "po_sc_detserialnumber_fk", "pro_status", "cre_userid_fk", "pro_serialnumber_fk", "serialnumber", "trans_pro_qty", "trans_date", "activestatus", "trans_type", "gr_do_detserialnumber_fk", "warehouse_serialnumber_fk");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "VoTrasactionMaster";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _cre_datetimeIsValid:Boolean;
    model_internal var _cre_datetimeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _cre_datetimeIsValidCacheInitialized:Boolean = false;
    model_internal var _cre_datetimeValidationFailureMessages:Array;
    
    model_internal var _trans_statusIsValid:Boolean;
    model_internal var _trans_statusValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _trans_statusIsValidCacheInitialized:Boolean = false;
    model_internal var _trans_statusValidationFailureMessages:Array;
    
    model_internal var _pro_statusIsValid:Boolean;
    model_internal var _pro_statusValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _pro_statusIsValidCacheInitialized:Boolean = false;
    model_internal var _pro_statusValidationFailureMessages:Array;
    
    model_internal var _trans_dateIsValid:Boolean;
    model_internal var _trans_dateValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _trans_dateIsValidCacheInitialized:Boolean = false;
    model_internal var _trans_dateValidationFailureMessages:Array;
    
    model_internal var _trans_typeIsValid:Boolean;
    model_internal var _trans_typeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _trans_typeIsValidCacheInitialized:Boolean = false;
    model_internal var _trans_typeValidationFailureMessages:Array;

    model_internal var _instance:_Super_VoTrasactionMaster;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _VoTrasactionMasterEntityMetadata(value : _Super_VoTrasactionMaster)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["cre_datetime"] = new Array();
            model_internal::dependentsOnMap["trans_status"] = new Array();
            model_internal::dependentsOnMap["po_sc_detserialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["pro_status"] = new Array();
            model_internal::dependentsOnMap["cre_userid_fk"] = new Array();
            model_internal::dependentsOnMap["pro_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["serialnumber"] = new Array();
            model_internal::dependentsOnMap["trans_pro_qty"] = new Array();
            model_internal::dependentsOnMap["trans_date"] = new Array();
            model_internal::dependentsOnMap["activestatus"] = new Array();
            model_internal::dependentsOnMap["trans_type"] = new Array();
            model_internal::dependentsOnMap["gr_do_detserialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["warehouse_serialnumber_fk"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
        }

        model_internal::_instance = value;
        model_internal::_cre_datetimeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCre_datetime);
        model_internal::_cre_datetimeValidator.required = true;
        model_internal::_cre_datetimeValidator.requiredFieldError = "cre_datetime is required";
        //model_internal::_cre_datetimeValidator.source = model_internal::_instance;
        //model_internal::_cre_datetimeValidator.property = "cre_datetime";
        model_internal::_trans_statusValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForTrans_status);
        model_internal::_trans_statusValidator.required = true;
        model_internal::_trans_statusValidator.requiredFieldError = "trans_status is required";
        //model_internal::_trans_statusValidator.source = model_internal::_instance;
        //model_internal::_trans_statusValidator.property = "trans_status";
        model_internal::_pro_statusValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPro_status);
        model_internal::_pro_statusValidator.required = true;
        model_internal::_pro_statusValidator.requiredFieldError = "pro_status is required";
        //model_internal::_pro_statusValidator.source = model_internal::_instance;
        //model_internal::_pro_statusValidator.property = "pro_status";
        model_internal::_trans_dateValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForTrans_date);
        model_internal::_trans_dateValidator.required = true;
        model_internal::_trans_dateValidator.requiredFieldError = "trans_date is required";
        //model_internal::_trans_dateValidator.source = model_internal::_instance;
        //model_internal::_trans_dateValidator.property = "trans_date";
        model_internal::_trans_typeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForTrans_type);
        model_internal::_trans_typeValidator.required = true;
        model_internal::_trans_typeValidator.requiredFieldError = "trans_type is required";
        //model_internal::_trans_typeValidator.source = model_internal::_instance;
        //model_internal::_trans_typeValidator.property = "trans_type";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity VoTrasactionMaster");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity VoTrasactionMaster");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoTrasactionMaster");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity VoTrasactionMaster");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoTrasactionMaster");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isCre_datetimeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isTrans_statusAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPo_sc_detserialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPro_statusAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCre_userid_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPro_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSerialnumberAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isTrans_pro_qtyAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isTrans_dateAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isActivestatusAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isTrans_typeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isGr_do_detserialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isWarehouse_serialnumber_fkAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnCre_datetime():void
    {
        if (model_internal::_cre_datetimeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCre_datetime = null;
            model_internal::calculateCre_datetimeIsValid();
        }
    }
    public function invalidateDependentOnTrans_status():void
    {
        if (model_internal::_trans_statusIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfTrans_status = null;
            model_internal::calculateTrans_statusIsValid();
        }
    }
    public function invalidateDependentOnPro_status():void
    {
        if (model_internal::_pro_statusIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPro_status = null;
            model_internal::calculatePro_statusIsValid();
        }
    }
    public function invalidateDependentOnTrans_date():void
    {
        if (model_internal::_trans_dateIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfTrans_date = null;
            model_internal::calculateTrans_dateIsValid();
        }
    }
    public function invalidateDependentOnTrans_type():void
    {
        if (model_internal::_trans_typeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfTrans_type = null;
            model_internal::calculateTrans_typeIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get cre_datetimeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get cre_datetimeValidator() : StyleValidator
    {
        return model_internal::_cre_datetimeValidator;
    }

    model_internal function set _cre_datetimeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_cre_datetimeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_cre_datetimeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeIsValid():Boolean
    {
        if (!model_internal::_cre_datetimeIsValidCacheInitialized)
        {
            model_internal::calculateCre_datetimeIsValid();
        }

        return model_internal::_cre_datetimeIsValid;
    }

    model_internal function calculateCre_datetimeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_cre_datetimeValidator.validate(model_internal::_instance.cre_datetime)
        model_internal::_cre_datetimeIsValid_der = (valRes.results == null);
        model_internal::_cre_datetimeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::cre_datetimeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::cre_datetimeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeValidationFailureMessages():Array
    {
        if (model_internal::_cre_datetimeValidationFailureMessages == null)
            model_internal::calculateCre_datetimeIsValid();

        return _cre_datetimeValidationFailureMessages;
    }

    model_internal function set cre_datetimeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_cre_datetimeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_cre_datetimeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get trans_statusStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get trans_statusValidator() : StyleValidator
    {
        return model_internal::_trans_statusValidator;
    }

    model_internal function set _trans_statusIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_trans_statusIsValid;         
        if (oldValue !== value)
        {
            model_internal::_trans_statusIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_statusIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get trans_statusIsValid():Boolean
    {
        if (!model_internal::_trans_statusIsValidCacheInitialized)
        {
            model_internal::calculateTrans_statusIsValid();
        }

        return model_internal::_trans_statusIsValid;
    }

    model_internal function calculateTrans_statusIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_trans_statusValidator.validate(model_internal::_instance.trans_status)
        model_internal::_trans_statusIsValid_der = (valRes.results == null);
        model_internal::_trans_statusIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::trans_statusValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::trans_statusValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get trans_statusValidationFailureMessages():Array
    {
        if (model_internal::_trans_statusValidationFailureMessages == null)
            model_internal::calculateTrans_statusIsValid();

        return _trans_statusValidationFailureMessages;
    }

    model_internal function set trans_statusValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_trans_statusValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_trans_statusValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_statusValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get po_sc_detserialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get pro_statusStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get pro_statusValidator() : StyleValidator
    {
        return model_internal::_pro_statusValidator;
    }

    model_internal function set _pro_statusIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_pro_statusIsValid;         
        if (oldValue !== value)
        {
            model_internal::_pro_statusIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_statusIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get pro_statusIsValid():Boolean
    {
        if (!model_internal::_pro_statusIsValidCacheInitialized)
        {
            model_internal::calculatePro_statusIsValid();
        }

        return model_internal::_pro_statusIsValid;
    }

    model_internal function calculatePro_statusIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_pro_statusValidator.validate(model_internal::_instance.pro_status)
        model_internal::_pro_statusIsValid_der = (valRes.results == null);
        model_internal::_pro_statusIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::pro_statusValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::pro_statusValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get pro_statusValidationFailureMessages():Array
    {
        if (model_internal::_pro_statusValidationFailureMessages == null)
            model_internal::calculatePro_statusIsValid();

        return _pro_statusValidationFailureMessages;
    }

    model_internal function set pro_statusValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_pro_statusValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_pro_statusValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_statusValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get cre_userid_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get pro_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get serialnumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get trans_pro_qtyStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get trans_dateStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get trans_dateValidator() : StyleValidator
    {
        return model_internal::_trans_dateValidator;
    }

    model_internal function set _trans_dateIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_trans_dateIsValid;         
        if (oldValue !== value)
        {
            model_internal::_trans_dateIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_dateIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get trans_dateIsValid():Boolean
    {
        if (!model_internal::_trans_dateIsValidCacheInitialized)
        {
            model_internal::calculateTrans_dateIsValid();
        }

        return model_internal::_trans_dateIsValid;
    }

    model_internal function calculateTrans_dateIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_trans_dateValidator.validate(model_internal::_instance.trans_date)
        model_internal::_trans_dateIsValid_der = (valRes.results == null);
        model_internal::_trans_dateIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::trans_dateValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::trans_dateValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get trans_dateValidationFailureMessages():Array
    {
        if (model_internal::_trans_dateValidationFailureMessages == null)
            model_internal::calculateTrans_dateIsValid();

        return _trans_dateValidationFailureMessages;
    }

    model_internal function set trans_dateValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_trans_dateValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_trans_dateValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_dateValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get activestatusStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get trans_typeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get trans_typeValidator() : StyleValidator
    {
        return model_internal::_trans_typeValidator;
    }

    model_internal function set _trans_typeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_trans_typeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_trans_typeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_typeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get trans_typeIsValid():Boolean
    {
        if (!model_internal::_trans_typeIsValidCacheInitialized)
        {
            model_internal::calculateTrans_typeIsValid();
        }

        return model_internal::_trans_typeIsValid;
    }

    model_internal function calculateTrans_typeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_trans_typeValidator.validate(model_internal::_instance.trans_type)
        model_internal::_trans_typeIsValid_der = (valRes.results == null);
        model_internal::_trans_typeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::trans_typeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::trans_typeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get trans_typeValidationFailureMessages():Array
    {
        if (model_internal::_trans_typeValidationFailureMessages == null)
            model_internal::calculateTrans_typeIsValid();

        return _trans_typeValidationFailureMessages;
    }

    model_internal function set trans_typeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_trans_typeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_trans_typeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_typeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get gr_do_detserialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get warehouse_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("cre_datetime"):
            {
                return cre_datetimeValidationFailureMessages;
            }
            case("trans_status"):
            {
                return trans_statusValidationFailureMessages;
            }
            case("pro_status"):
            {
                return pro_statusValidationFailureMessages;
            }
            case("trans_date"):
            {
                return trans_dateValidationFailureMessages;
            }
            case("trans_type"):
            {
                return trans_typeValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
